# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kdepim-apps-libs
pkgver=20.04.3
pkgrel=0
pkgdesc="KDE PIM mail related libraries"
arch="all !armhf"
url="https://kontact.kde.org/"
license="GPL-2.0-or-later AND LGPL-2.0-or-later"
makedepends="extra-cmake-modules qt5-qtbase-dev kconfig-dev kconfigwidgets-dev
	kcoreaddons-dev ki18n-dev kiconthemes-dev kio-dev kservice-dev
	kwidgetsaddons-dev akonadi-dev akonadi-contacts-dev kcontacts-dev
	grantleetheme-dev pimcommon-dev libkleo-dev gpgme-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kdepim-apps-libs-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# kaddressbookgrantlee-printing-grantleeprinttest is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "kaddressbookgrantlee-printing-grantleeprinttest"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="3858a3ec173545383f71a02ca55662f7fd636d55f187cf0a46b1c2b663e793a298f053768e7ed4d0fec812e1cebdfce62a390d4a912bb2fc363673edeee464e1  kdepim-apps-libs-20.04.3.tar.xz"
